// 解析 Number 类

let names ;

console.log( '- - - - - Number静态属性 - - - - -' );

names = Object.getOwnPropertyNames( Number );
console.log( names );

console.log( '- - - - - Number原型属性 - - - - -' );

names = Object.getOwnPropertyNames( Number.prototype );
console.log( names );


console.log( '- - - - - Number.MAX_SAFE_INTEGER / Number.MAX_VALUE - - - - -' );

console.log( Number.MAX_SAFE_INTEGER ); // 2 **53 - 1
console.log( Number.MAX_VALUE );

console.log( Number.MIN_SAFE_INTEGER );

console.log( '- - - - - Number.parseInt / Number.parseFloat - - - - -' );

let str = 'dedede' ;
let radix = 16 ;
let num ;

num = Number.parseInt( str , radix );
console.log( num );

num = Number.parseInt( str ); // 若未指定第二个参数则默认按照十进制解析
console.log( num );

str = 'xx' ;
radix = 36 ; // radix 的取值范围是 [ 2 , 36 ]
num = Number.parseInt( str , radix );
console.log( num );

str = '123.321' ;
console.log( str , typeof str );
num = Number.parseFloat( str );
console.log( num , typeof num );

console.log( '- - - - - Number.prototype.toPrecision - - - - -' );

let x = new Number( 123.4567890 );
console.log( x );
console.log( x.toPrecision() );
console.log( x.toPrecision( 2 ) );
console.log( x.toPrecision( 3 ) );
console.log( x.toPrecision( 4 ) );
console.log( x.toPrecision( 5 ) );
